#ifndef _DevicesInfrared_H_
#define _DevicesInfrared_H_


#define INFRARED_CHANNEL_LEFT           0x01
#define INFRARED_CHANNEL_RIGHT          0x02
#define INFRARED_CHANNEL_LEFT_FRONT     0x04
#define INFRARED_CHANNEL_RIGHT_FRONT    0x08

#define INFRARED_VALUE_LEFT             0x03
#define INFRARED_VALUE_RIGHT            0x0C
#define INFRARED_VALUE_LEFT_FRONT       0x05
#define INFRARED_VALUE_RIGHT_FRONT      0x0A




#define INFRARED_LEFT_SET_1() do { TIM1->CCDAT1 = TIM1->AR / 2; } while(0)
#define INFRARED_LEFT_SET_0() do { TIM1->CCDAT1 = 0; } while(0)

#define INFRARED_RIGHT_SET_1() do { TIM1->CCDAT2 = TIM1->AR / 2; } while(0)
#define INFRARED_RIGHT_SET_0() do { TIM1->CCDAT2 = 0; } while(0)

#define INFRARED_LEFT_FRONT_SET_1() do { TIM1->CCDAT3 = TIM1->AR / 2; } while(0)
#define INFRARED_LEFT_FRONT_SET_0() do { TIM1->CCDAT3 = 0; } while(0)

#define INFRARED_RIGHT_FRONT_SET_1() do { TIM1->CCDAT4 = TIM1->AR / 2; } while(0)
#define INFRARED_RIGHT_FRONT_SET_0() do { TIM1->CCDAT4 = 0; } while(0)



void vInfraredInit(void);
void vInfraredInputInit(void);
void vInfraredOutputInit(void);
int8_t cInfraredSendValue(uint8_t ucChannel, uint8_t ucValue);

#endif
